//
//  SNKDetailWebModel.m
//  SleepNews
//
//  Created by Kavee DJ on 2016/12/10.
//  Copyright © 2016年 Kavee DJ. All rights reserved.
//

#import "SNKDetailWebModel.h"
#import "SNKDetailImageWebModel.h"

@implementation SNKDetailWebModel

+ (instancetype)detailWithDict:(NSDictionary *)dict
{
    SNKDetailWebModel *detail = [[self alloc]init];
    detail.title = dict[@"title"];
    detail.ptime = dict[@"ptime"];
    detail.body = dict[@"body"];
    
    NSArray *imgArray = dict[@"img"];
    NSMutableArray *temArray = [NSMutableArray arrayWithCapacity:imgArray.count];
    
    for (NSDictionary *dict in imgArray) {
        SNKDetailImageWebModel *imgModel = [SNKDetailImageWebModel detailImgWithDict:dict];
        [temArray addObject:imgModel];
    }
    detail.img = temArray;
    
    return detail;
}

@end
